/*
 * @Date: 2025-02-02 22:56:45
 * @LastEditors: 吴世扬 18368095041@163.com
 * @LastEditTime: 2025-02-18 10:34:34
 * @FilePath: /vue3-admin/src/api/my.ts
 */

import { request } from '@/utils';
import type { MyInfo } from '@/typings/api/my';

export const readMyInfo = () => {
    return request<HttpResult<MyInfo>>({
        url: '/admin/api/v1/my/info',
        method: 'get'
    }).then((res) => {
        return res.data;
    });
};

export class PasswordParam {
    originPassword = '';
    newPassword = '';
}

export const updateMyPassword = (data: PasswordParam) => {
    return request<HttpResult>({
        url: '/admin/api/my/password/change',
        method: 'post',
        data
    }).then((res) => {
        return res.data;
    });
};
